#pragma once

#include <string>
#include <memory>
#include <ast/ast.h>
#include <parser.h> // from src/parser bison genarate

#ifdef YY_DECL
#undef YY_DECL
#endif

#define YY_DECL yy::Parser::symbol_type yylex(Front & front)
YY_DECL;

class Front {
public:
  Front();

  std::unique_ptr<ast::NodeCompUnit> result;

  int parse(const std::string & file_path);

  std::string file;
  bool trace_parsing;

  void scan_begin();
  void scan_end();

  bool trace_scanning;

  yy::location loc;
};
